Determine the type of an OLE

Say that I have located an OLE object using oleCount() or containsOle().

How would I go about determining the type of the OLE object? Is it an image, an Excel spreadsheet, a Word document, or other?

Thanks!


Bob3 - Fri Oct 04 16:09:25 EDT 2019

Re: Determine the type of an OLE
morast - Mon Oct 07 06:52:43 EDT 2019

I think you have to parse the RichText.

Some example code...

Regexp rxExcelOle = regexp2 "objclass Excel" 
Object o = current
Buffer buf = create
buf = richTextWithOle(o."Object Text")

if ( rxExcelOle buf ) print "found Excel OLE\n"

delete buf
delete rxExcelOle

 

Re: Determine the type of an OLE
Bob3 - Mon Oct 07 10:46:25 EDT 2019

morast - Mon Oct 07 06:52:43 EDT 2019

I think you have to parse the RichText.

Some example code...

Regexp rxExcelOle = regexp2 "objclass Excel" 
Object o = current
Buffer buf = create
buf = richTextWithOle(o."Object Text")

if ( rxExcelOle buf ) print "found Excel OLE\n"

delete buf
delete rxExcelOle

 

Thanks for your helpful reply, Morast! It works great and is easy to modify for hunting Word objects, as well.